<template>
  <div>
    <!-- <el-button type="primary" plain>改名改证件</el-button>
    <div class="m-title"><span class="icon"></span>改名改证件</div> -->
    <!-- 客户改名改证件form表单 start -->
    <el-form
      ref="ChangeNameFormRef"
      :model="dataParams"
      :label-position="labelPosition"
      label-width="100px"
    >
      <el-row>
        <el-col :span="24"
          ><div class="grid-content bg-purple">
            <el-form-item label="客户名称" class="u-ipt" prop="partyName">
              <el-input
                placeholder=""
                v-model="dataParams.partyName"
                class="input-with-select"
                :disabled="flag==='changeName'? false:true"
              >
              </el-input>
            </el-form-item></div
        ></el-col>
        <el-col :span="24">
          <div class="grid-content bg-purple">
            <el-form-item label="证件类型" prop="certType">
              <el-select
                v-model="dataParams.certType"
                placeholder="请选择"
                class="select-box"
                @change="custNumberTypeChange"
              >
                <el-option
                  v-for="item in cardTypeArr"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item></div
        ></el-col>
        <el-col :span="24"
          ><div class="grid-content bg-purple">
            <el-form-item label="证件号码" class="u-ipt"  prop="certNum">
              <el-input
                placeholder=""
                v-model="dataParams.certNum"
                class="input-with-select"
                 :disabled="flag==='changeName'? false:true"
              >
              </el-input>
            </el-form-item></div
        ></el-col>
        <el-col :span="24"
          ><div class="grid-content bg-purple">
            <el-form-item label="证件地址" class="u-ipt" prop="certAddr">
              <el-input
                type="textarea"
                :rows="2"
                placeholder="请输入内容"
                v-model="dataParams.certAddr"
                class="input-with-select"
                 :disabled="flag==='changeName'? false:true"
              >
              </el-input>
            </el-form-item></div
        ></el-col>
        <el-col :span="24"
          ><div class="grid-content bg-purple">
            <el-form-item
              label="行业类型"
              class="u-ipt"
              prop="industryCd"
              v-if="dataParams.cardType == '2' ? true : false"
            >
              <input-drawer
                :value="dataParams.industryCd"
                title="行业类型"
                ref="commonRegionIdRef"
                size="30%"
                model="1"
                :append-to-body="true"
                :before-close="handleClose"
              >
                <div class="m-tree-box">
                  <el-tree
                    ref="tree"
                    :data="industryCdTree"
                    :props="defaultProps"
                    :highlight-current="true"
                    node-key="industryTypeId"
                    :default-expanded-keys="defaultShowNodes"
                    @node-click="handleTree"
                  >
                  </el-tree>
                </div>
              </input-drawer>
            </el-form-item></div
        ></el-col>
        <el-col :span="24"
          ><div class="grid-content bg-purple">
            <el-form-item label="证件复印件照片" prop="photoPath">
              <el-upload
                class="avatar-uploader"
                action="https://jsonplaceholder.typicode.com/posts/"
                :show-file-list="false"
                :on-success="handleAvatarSuccess"
                :before-upload="beforeAvatarUpload"
              >
                <img
                  v-if="dataParams.photoPath"
                  :src="dataParams.photoPath"
                  class="avatar"
                />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item></div
        ></el-col>
      </el-row>
    </el-form>
    <!-- 客户改名改证件form表单 end-->
  </div>
</template>

<script>
import InputDrawer from "@/components/public/forms/InputDrawer";
import CustomerInfoManageServer from "@/api/customer/CustomerInfoManageServer";
export default {
  name: "ChangeName",

  data() {
    return {
      dataList:{},
   
    };
  },
  components: {
    InputDrawer,
  },
 computed: {
   partyId(){
     return this.dataParams.partyId
   }
 },
  created() {},
  mounted() {
    //  this.initChangeName(this.dataParams.partyId,this.dataParams.custId);
    this.industryCdTree.forEach((item) => {
      this.defaultShowNodes.push(item.id);
      
    });
  },
  beforeDestroy(){
    
  },
  destroyed(){
    
  },
  methods: {
   
    // 改名改证件初始化服务
   
  },
};
</script>
<style lang="scss" scoped>
.m-title {
  margin-top: 20px;
  margin-bottom: 20px;
  color: #0052d9;
  font-size: 12px;
}
.m-title .icon {
  float: left;
  display: block;
  width: 4px;
  height: 12px;
  background: #f56f3c;
  margin-top: 2px;
  margin-right: 10px;
  font-size: 14px;
}
.el-drawer__header {
  display: none;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 0.28rem;
  color: #8c939d;
width: 1.78rem;
  height: 1.78rem;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 1.78rem;
  height: 1.78rem;
  display: block;
}
.select-box {
  width: 100%;
}
</style>
